﻿using System;

namespace SharpSqlAnalyzer.nodes
{
	// Token: 0x02000287 RID: 647
	public class TCaseExpression : TParseTreeNode
	{
		// Token: 0x170003CB RID: 971
		// (get) Token: 0x060014CB RID: 5323 RVA: 0x00325408 File Offset: 0x00323608
		// (set) Token: 0x060014CC RID: 5324 RVA: 0x00325410 File Offset: 0x00323610
		public virtual TExpression Else_expr
		{
			get
			{
				return this._else_expr;
			}
			set
			{
				this._else_expr = value;
			}
		}

		// Token: 0x170003CC RID: 972
		// (get) Token: 0x060014CD RID: 5325 RVA: 0x00325419 File Offset: 0x00323619
		// (set) Token: 0x060014CE RID: 5326 RVA: 0x00325421 File Offset: 0x00323621
		public virtual TExpression Input_expr
		{
			get
			{
				return this._input_expr;
			}
			set
			{
				this._input_expr = value;
			}
		}

		// Token: 0x170003CD RID: 973
		// (get) Token: 0x060014CF RID: 5327 RVA: 0x0032542A File Offset: 0x0032362A
		// (set) Token: 0x060014D0 RID: 5328 RVA: 0x00325432 File Offset: 0x00323632
		public virtual TWhenClauseItemList WhenClauseItemList
		{
			get
			{
				return this._whenClauseItemList;
			}
			set
			{
				this._whenClauseItemList = value;
			}
		}

		// Token: 0x170003CE RID: 974
		// (get) Token: 0x060014D1 RID: 5329 RVA: 0x0032543B File Offset: 0x0032363B
		// (set) Token: 0x060014D2 RID: 5330 RVA: 0x00325443 File Offset: 0x00323643
		public virtual TStatementListSqlNode Else_statement_node_list
		{
			get
			{
				return this._else_statement_node_list;
			}
			set
			{
				this._else_statement_node_list = value;
			}
		}

		// Token: 0x170003CF RID: 975
		// (get) Token: 0x060014D3 RID: 5331 RVA: 0x0032544C File Offset: 0x0032364C
		// (set) Token: 0x060014D4 RID: 5332 RVA: 0x00325467 File Offset: 0x00323667
		public virtual TStatementList Else_statement_list
		{
			get
			{
				if (this._else_statement_list == null)
				{
					this._else_statement_list = new TStatementList();
				}
				return this._else_statement_list;
			}
			set
			{
				this._else_statement_list = value;
			}
		}

		// Token: 0x060014D5 RID: 5333 RVA: 0x00325470 File Offset: 0x00323670
		public override void init(object arg1, object arg2, object arg3)
		{
			this._input_expr = (TExpression)arg1;
			this._whenClauseItemList = (TWhenClauseItemList)arg2;
			if (arg3 is TExpression)
			{
				this._else_expr = (TExpression)arg3;
				return;
			}
			this._else_statement_node_list = (TStatementListSqlNode)arg3;
		}

		// Token: 0x060014D6 RID: 5334 RVA: 0x003254AC File Offset: 0x003236AC
		public override void doParse(TCustomSqlStatement psql, ESqlClause plocation)
		{
			if (this._input_expr != null)
			{
				this._input_expr.doParse(psql, plocation);
			}
			this._whenClauseItemList.doParse(psql, plocation);
			if (this._else_expr != null)
			{
				this._else_expr.doParse(psql, plocation);
			}
			if (this._else_statement_node_list != null)
			{
				this._else_statement_node_list.doParse(psql, plocation);
				for (int i = 0; i < this._else_statement_node_list.size(); i++)
				{
					this.Else_statement_list.add(this._else_statement_node_list.getStatementSqlNode(i).Stmt);
				}
			}
		}

		// Token: 0x060014D7 RID: 5335 RVA: 0x00325537 File Offset: 0x00323737
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x060014D8 RID: 5336 RVA: 0x00325548 File Offset: 0x00323748
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			if (this._input_expr != null)
			{
				this._input_expr.acceptChildren(v);
			}
			this._whenClauseItemList.acceptChildren(v);
			if (this._else_expr != null)
			{
				this._else_expr.acceptChildren(v);
			}
			if (this._else_statement_node_list != null)
			{
				this.Else_statement_list.acceptChildren(v);
			}
			v.postVisit(this);
		}

		// Token: 0x040016FC RID: 5884
		private TExpression _input_expr;

		// Token: 0x040016FD RID: 5885
		private TExpression _else_expr;

		// Token: 0x040016FE RID: 5886
		private TWhenClauseItemList _whenClauseItemList;

		// Token: 0x040016FF RID: 5887
		private TStatementListSqlNode _else_statement_node_list;

		// Token: 0x04001700 RID: 5888
		private TStatementList _else_statement_list;
	}
}
